package com.culture.bootdemo.common.exception;

import com.culture.bootdemo.common.basevo.ResultCode;
import lombok.Getter;

/**
 * @author ：wen
 * @date ：Created in 2019/8/2 18:23
 * @description：:
 */
public class BusinessException extends RuntimeException {

    @Getter
    private int errcode;

    @SuppressWarnings("NullableProblems")
    @Getter
    private String errmsg;

    public BusinessException(ResultCode resultCode) {
        this(resultCode.getCode(), resultCode.getMsg());
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(Integer errcode, String errmsg) {
        super(errmsg);
        this.errcode = errcode;
        this.errmsg = errmsg;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}

